<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>修改设计（零部件库）-头部（JSP导入）</title>
    
    <%@ include file="../common/common.jsp"%>
    
	<link href="<%=request.getContextPath() %>/resources/css/system/index/common.css" rel="stylesheet"></link>
	<link href="<%=request.getContextPath() %>/resources/css/system/index/client.css" rel="stylesheet"></link>
    
    <script src="<%=request.getContextPath() %>/resources/js/system/carDesign/btnStyle.js" type="text/javascript"></script>
    
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
  	
  	<div class="design-head">
		<div class="design-headLeft btnBox">
			<!-- <a class="a-black" href="front/partDesign/partDesignModify">零部件库</a> -->
			<a class="a-black activeBtn" href="front/partDesign/myPartDesignModify">我的零部件库</a>
		</div>
 			
		<div class="design-headRight right" id="designComplete">
			<a class="a-black" href="javascript:showMyPartHeadModal()">
	 			<div class="design-headImg">
	 				<img src="<%=basePath %>/resources/images/close.png"/>
	 			</div>
	 			<div>完成</div>
			</a>
		</div>
 	</div>
 	
 	
    <!-- Modal 完成-->
	<div class="modal fade" id="modifyHeadModal" tabindex="-1" role="dialog" aria-labelledby="carModifyModalLabel" data-backdrop="static">
	  <div class="modal-dialog modal-sm">
	    <form action="">
		    <div class="modal-content">
		      
		      <div class="modal-body">
				  <div class="carModal-body">
				    <i class="fa fa-check-circle"></i>
				    <span>您是否确定要退出？</span>
				  </div>
		      </div>
		      
		      <div class="modal-footer carModal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		        <button type="button" class="btn btn2 a-white" onclick="Back();">保存并退出</button>
		      </div>
		      
		    </div>
	     </form>
	  </div>
	</div>
 	<script type="text/javascript">
 		function Back(){
 			var id=$("#id").val();
 			if(id==''){
 				window.location.href="<%=basePath %>front/partDesign/partDesign_list";
 			}else{
 				$('#myPartDesignform').ajaxSubmit({
 					type : "POST",
		    		url: CONTEXT_PATH+'front/partDesign/updateMyPartDesign',
		    		dataType: "json",
		    		cache : false,  
	        		async : false,
	        		success: function(data) {
	        			if(data.result){
	        				window.location.href="<%=basePath %>front/partDesign/partDesign_list";
	        			}else{
	        				jAlert("保存失败！","提示");
	        			}
	        		}
 				});
 			}
  		}
 		
  		function showMyPartHeadModal(){
  	     	$("#modifyHeadModal").show();
  		} 		 
  		 		 
		$(document).ajaxComplete(function(event, xhr, settings) {
		    //从http头信息取出 在filter定义的sessionstatus，判断是否是 timeout
		    if(xhr.getResponseHeader("sessionstatus")=="timeout"){ 
		        //从http头信息取出登录的url ＝ loginPath
		        if(xhr.getResponseHeader("loginPath")){
		             jAlert("会话过期，请重新登陆!","提示",function(){
			             //打会到登录页面
			             window.location.replace(xhr.getResponseHeader("loginPath"));  
		             }); 
		            
		        }else{  
		       
		            jAlert("请求超时请重新登陆 !","提示");
		        }  
		    }  
		}); 
  	</script>
  	
  </body>
</html>
